{extend name="layout" /}
{block name="head"}
<style>
    html{background: #FFF;}
</style>
{/block}
{block name="page"}
<form class="layui-form">
    <div class="layui-form-item">
        <label class="layui-form-label">父节点</label>
        <div class="layui-input-inline">
            <select name="pid">
                <option value="0">根节点</option>
                {volist name="node" id="v"}
                <option value="{$v.id}"{eq name="data.pid" value="$v.id"} selected{/eq}>{$v._name|raw}</option>
                {/volist}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">节点名称</label>
        <div class="layui-input-block">
            <input type="text" name="name" value="{$data.name|default=''}" lay-verify="required" placeholder="请输入节点名称" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">Module</label>
        <div class="layui-input-block">
            <input type="text" name="module" value="{$data.module|default=''}" lay-verify="required" placeholder="请输入Module" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">Controller</label>
        <div class="layui-input-block">
            <input type="text" name="controller" value="{$data.controller|default=''}" placeholder="请输入Controller" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">Action</label>
        <div class="layui-input-block">
            <input type="text" name="action" value="{$data.action|default=''}" placeholder="请输入Action" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">ICON图标</label>
        <div class="layui-input-block">
            <input type="text" name="icon" value="{$data.icon|default=''}" placeholder="请输入ICON图标Class,一级菜单有效" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            <input type="radio" name="show" value="1" title="显示" {eq name="data.show" value="1"}checked{/eq}>
            <input type="radio" name="show" value="0" title="隐藏" {eq name="data.show" value="0"}checked{/eq}>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="dosub">提 交</button>
        </div>
    </div>
</form>
{/block}
{block name="js"}
<script>
    layui.config({
        base: '__STATIC__/js/'
    }).use(['app'], function () {
        var app=layui.app;
        var $ = layui.$;
        var form = layui.form;
        form.on('submit(dosub)', function (data) {
            app.post(data.field, 1);
            return false;
        });
    });
</script>
{/block}